﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
	
	<Style x:Key="CbrStandardListBox" TargetType="{x:Type ListBox}">
		<Setter Property="VirtualizingStackPanel.IsVirtualizing" Value="True"/>
		<Setter Property="VirtualizingStackPanel.VirtualizationMode" Value="Standard"/>
		<Setter Property="OverridesDefaultStyle" Value="true"/>
		<Setter Property="Background" Value="Transparent"/>
		<Setter Property="BorderThickness" Value="0"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type ListBox}">
					<Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="1" SnapsToDevicePixels="True">
						<ScrollViewer Style="{DynamicResource CbrScrollViewer}" Focusable="False" Padding="{TemplateBinding Padding}">
							<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
						</ScrollViewer>
					</Border>
					<ControlTemplate.Triggers>
						<Trigger Property="IsEnabled" Value="False">
							<Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.InactiveCaptionTextBrushKey}}"/>
						</Trigger>
						<Trigger Property="IsGrouping" Value="True">
							<Setter Property="ScrollViewer.CanContentScroll" Value="False"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
		<Style.Resources>
			<Style TargetType="{x:Type ListBoxItem}">
				<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
				<Setter Property="Background" Value="{DynamicResource CbrBackgroundNormal}"/>
				<Setter Property="BorderBrush" Value="Transparent"/>
				<Setter Property="Template">
					<Setter.Value>
						<ControlTemplate TargetType="{x:Type ListBoxItem}">
							<Grid Margin="4,0,4,4">
								<Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" 
										BorderThickness="1" SnapsToDevicePixels="True"/>
								<ContentPresenter Margin="8,5"/>
							</Grid>
							<ControlTemplate.Triggers>
								<MultiTrigger>
									<MultiTrigger.Conditions>
										<Condition Property="IsMouseOver" Value="True" />
										<Condition Property="IsSelected" Value="False"/>
									</MultiTrigger.Conditions>
									<Setter Property="Background" Value="{DynamicResource CbrBackgroundHighlighted}" />
									<Setter Property="BorderBrush" Value="{DynamicResource CbrBorderBrushHighlighted}" />
								</MultiTrigger>
								<Trigger Property="IsSelected" Value="True">
									<Setter Property="Background" Value="{DynamicResource CbrBackgroundSelected}" />
									<Setter Property="BorderBrush" Value="{DynamicResource CbrBorderBrushSelected}" />
								</Trigger>
							</ControlTemplate.Triggers>
						</ControlTemplate>
					</Setter.Value>
				</Setter>
			</Style>
		</Style.Resources>
	</Style>

</ResourceDictionary>